<template>
  <el-form 
    ref="basicInfoForm"
    :model="info"
    :rules="rules"
    :inline="true"
    label-width="80px"
  >
    <el-form-item label="BOM名称" prop="bomName">
      <el-input
        v-model="info.bomName"
        placeholder="请输入BOM名称"
        style="width: 200px"
        disabled
      />
    </el-form-item>
    <el-form-item label="BOM编码" prop="bomCode">
      <el-input
        v-model="info.bomCode"
        placeholder="请输入BOM编码"
        style="width: 200px"
        disabled
      />
    </el-form-item>
    <el-form-item label="BOM状态" prop="bomStatus">
      <el-select
        v-model="info.bomStatus"
        placeholder="请选择BOM状态"
        style="width: 200px"
        disabled
      >
        <el-option
          v-for="dict in bomStatusOptions"
          :key="dict.dictValue"
          :label="dict.dictLabel"
          :value="parseInt(dict.dictValue)"
        ></el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="BOM版本" prop="bomEdition">
      <el-input
        v-model="info.bomEdition"
        placeholder="请输入BOM版本"
        style="width: 200px"
        disabled
      />
    </el-form-item>
  </el-form>
</template>

<script>
  export default {
    name: "BasicInfoForm",
    props: {
      info: {
        type: Object,
        default: null,
      },
    },
    data() {
      return {
        // BOM状态字典
        bomStatusOptions: [],
        rules: {},
      };
    },
    created() {
      this.getDicts("sys_normal_disable").then((response) => {
        this.bomStatusOptions = response.data;
      });
    },
  };
</script>
  